﻿using System.Collections.Generic;
using System.Linq;
using DAL;
using System.Web.Mvc;
using System;
namespace BLL
{
    public class BaseDDL : IDisposable
    {    
        /// <summary>
        /// 获取字段，首选默认,Text和Value是同一个值
        /// </summary>
        /// <returns></returns>
        public List<SelectListItem> GetSysFields(string table, string colum)
        {
            using (SysEntities db = new SysEntities())
            {
                return (from m in db.SysFields
                        where m.MyTables == table
                        where m.MyColums == colum
                        orderby m.Sort
                        select new SelectListItem { Text = m.MyTexts, Value = m.MyTexts }).ToList();
            }
        }

        public void Dispose()
        {
        }
    }
}
